import store from "@/store";
import dayjs from "dayjs";
export const itemStyle = {
  marginBottom: 0,
  padding: "10px 40px",
};

// 表单配置项
export const formBase = [
  {
    label: "录入时间",
    type: "daterange",
    field: "shelfTime",
    prop: "shelfTime",
    required: true,
    otherOptions: {
      disabled: false,
      rangeSeparator: "至",
      startPlaceholder: "开始日期",
      endPlaceholder: "结束日期",
      pickerOptions: {
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              const end = dayjs().format("YYYY-MM-DD 23:59:59");
              const start = dayjs().format("YYYY-MM-DD 00:00:00");
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              end.setTime(start.getTime() - 3600 * 1000 * 24);
              start.setTime(start.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
    },
  },
  {
    type: "input",
    field: "courierNumbers",
    label: "快递单号",
    otherOptions: {},
  },
  {
    type: "input",
    field: "sendEmail",
    label: "发送邮箱",
    otherOptions: {},
  },
  {
    type: "select",
    field: "isSend",
    label: "发送状态",
    optionsKey: "label",
    optionsValue: "value",
    options: [
      {
        value: 0,
        label: "未发送",
      },
      {
        value: 1,
        label: "已发送",
      },
    ],
  },
];

// 表格配置项
export const tableBase = [
  {
    label: "ID",
    prop: "id",
  },
  {
    label: "快递单号",
    prop: "courierNumber",
    width: 140,
  },
  {
    label: "邮箱",
    prop: "email",
    width: 200,
  },
  {
    label: "内容",
    prop: "content",
    width: 300,
  },
  {
    label: "标识",
    prop: "identifying",
    width: 140,
  },
  {
    label: "提醒类型",
    prop: "type",
    prop: "type",
    width: 140,
  },
  {
    label: "创建时间（录入时间）",
    prop: "createTime",
    width: 140,
  },
  {
    label: "发送时间",
    prop: "sendTime",
    width: 140,
  },
];
